import { isNotBlank } from 'web-plugin-utils';

export const EasyPlayer = ({
  url,
  play,
  muted,
}: {
  url: string;
  play: boolean;
  muted: boolean;
}) => {
  return (
    // @ts-ignore
    <easy-player
      style={{ flex: 1 }}
      video-url={play ? (isNotBlank(url) ? url : '') : ''}
      live="true"
      muted={muted}
      alt="无信号"
      reconnection="true"
      easy-stretch="false"
      debug="true"
      progress="true"
      is-trans-coding="false"
      decode-type="auto"
    />
  );
};
